package com.itheima.bos.service.impl;

import com.itheima.bos.dao.impl.SubareaDaoImpl;
import com.itheima.bos.domain.Subarea;
import com.itheima.bos.service.ISubareaService;
import com.itheima.bos.utils.PageBean;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Mr.King on 2017/3/12.
 */
@Service
@Transactional
public class SubareaServiceImpl implements ISubareaService {

    @Autowired
    private SubareaDaoImpl subareaDao;

    @Override
    public void saveOrUpdate(Subarea model) {
        subareaDao.saveOrUpdate(model);
    }

    @Override
    public void pageQuery(PageBean pageBean) {
        subareaDao.pageQuery(pageBean);
    }

    @Override
    public List<Subarea> findAll() {
        return subareaDao.findAll();
    }

    @Override
    public List<Subarea> findListByAjax(DetachedCriteria criteria) {
        return subareaDao.findCriteria(criteria);
    }

}
